<?php
/**
 * CreateTime: 2022/8/8 10:43
 */

namespace App\Func;

use App\Consts\ResponseConsts\ResponseStatusConsts;
use App\Models\Client\CreditClientModel;
use Illuminate\Http\Exceptions\HttpResponseException;

class CreditClientFunc
{
    public static function getCreditClientIdByClientId($clientId){
        $ccm = new CreditClientModel();
        $creditClientId = $ccm->getCreditClientInfoByClientId($clientId,['credit_client_id'])['credit_client_id'];
        if(!$creditClientId){
            throw new HttpResponseException( ResponseFunc::returnJson(
               'error',
               '',
               '当前客户不存在信用详情',
               ResponseStatusConsts::OK_200_RESPONSE_STATUS,
           ));
        }
        return $creditClientId;
    }
}